﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TR.Domain.Entity;
using TR.Domain.Repository.rbac_UserRepository;

namespace TR.EFCore.Repository.rbac_UserRepository
{
    public class rbac_UserRepository : Irbac_UserRepository
    {

        private readonly MyContext context;

        public rbac_UserRepository(MyContext context)
        {
            this.context = context;
        }

        //根据登录名查询用户信息
        public async Task<rbac_User> UserSelect(string uname)
        {
            var result = await context.rbac_User.Where(p => p.U_UserName == uname).FirstOrDefaultAsync();

            return result;
        }
    }
}
